package com.test.group6.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.test.group6.domain.WorkesInformation;

@Mapper
public interface AddWorkesMapper {
	@Insert("insert into workes_information("
			+ "id,name,job,sex,birth,education,register_date,"
			+ "enterprise_id)"
			+ "values("
			+ "#{workesInformation.id},#{workesInformation.name},"
			+ "#{workesInformation.job},#{workesInformation.sex},"
			+ "#{workesInformation.birth},#{workesInformation.education},"
			+ "#{workesInformation.registerDate},#{workesInformation.enterpriseId}"
			+ ")")
    int addNewWorkes(@Param("workesInformation")WorkesInformation workesInformation);
	
	@Select("select id from workes_information order by id desc limit 0,1")
    String getMaxIdInWorkes();
}
